Optimal. Leaf size=322 \[ -\frac {2 a b \sin (e+f x) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac {1}{2};\frac {1}{2} (n p-2),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {a^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac {1}{2};\frac {1}{2} (n p-3),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {b^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac {1}{2};\frac {1}{2} (n p-1),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.56, antiderivative size = 322, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {3948, 3869, 2824, 3189, 429} \[ -\frac {2 a b \sin (e+f x) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac {1}{2};\frac {1}{2} (n p-2),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {a^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac {1}{2};\frac {1}{2} (n p-3),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {b^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac {1}{2};\frac {1}{2} (n p-1),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 429
Rule 2824
Rule 3189
Rule 3869
Rule 3948
Rubi steps
\begin {align*} \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx &=\left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {(d \sec (e+f x))^{n p}}{(a+b \sec (e+f x))^2} \, dx\\ &=\left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{2-n p}(e+f x)}{(b+a \cos (e+f x))^2} \, dx\\ &=\left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac {b^2 \cos ^{2-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2}-\frac {2 a b \cos ^{3-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2}+\frac {a^2 \cos ^{4-n p}(e+f x)}{\left (-b^2+a^2 \cos ^2(e+f x)\right )^2}\right ) \, dx\\ &=\left (a^2 \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{4-n p}(e+f x)}{\left (-b^2+a^2 \cos ^2(e+f x)\right )^2} \, dx-\left (2 a b \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{3-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2} \, dx+\left (b^2 \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{2-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2} \, dx\\ &=-\frac {\left (2 a b \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (2-n p)}}{\left (-a^2+b^2+a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}+\frac {\left (a^2 \cos ^{n p+2 \left (\frac {1}{2}-\frac {n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac {1}{2}+\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (3-n p)}}{\left (a^2-b^2-a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}+\frac {\left (b^2 \cos ^{n p+2 \left (\frac {1}{2}-\frac {n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac {1}{2}+\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (1-n p)}}{\left (-a^2+b^2+a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=-\frac {2 a b F_1\left (\frac {1}{2};\frac {1}{2} (-2+n p),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac {a^2 F_1\left (\frac {1}{2};\frac {1}{2} (-3+n p),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac {b^2 F_1\left (\frac {1}{2};\frac {1}{2} (-1+n p),2;\frac {3}{2};\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 45.37, size = 14108, normalized size = 43.81 \[ \text {Result too large to show} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.49, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{b^{2} \sec \left (f x + e\right )^{2} + 2 \, a b \sec \left (f x + e\right ) + a^{2}}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{{\left (b \sec \left (f x + e\right ) + a\right )}^{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (c \left (d \sec \left (f x +e \right )\right )^{p}\right )^{n}}{\left (a +b \sec \left (f x +e \right )\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (c\,{\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^p\right )}^n}{{\left (a+\frac {b}{\cos \left (e+f\,x\right )}\right )}^2} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n}}{\left (a + b \sec {\left (e + f x \right )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________